package com.hzmall.dao;

import com.hzmall.pojo.Product;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ProductMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Product record);

    int insertSelective(Product record);

    Product selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Product record);

    int updateByPrimaryKey(Product record);

    List<Product> selectAllProducts();

    List<Product> selectProductByCategoryIdAndProductName(@Param("categoryId") Integer categoryId,@Param("productName") String productName);

    Integer reduceProductStock(@Param("productId") Integer productId,@Param("count") Integer count);

    List<Product> selectProductByProductNameAndProductId(@Param("productName")String productName,@Param("productId")Integer productId);

    Integer countProduct();

    Integer selectStockByProductId(Integer productId);
}